<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="song-form">
                <input type="hidden" id="deptId" name="deptId">
                <input type="hidden" id="parentId" name="parentId">
                <div class="select-list">
                    <ul>
                        <li>
                            歌曲名：<input type="text" name="songName"/>
                        </li>
                        <li>
                            级别：<select name="level" th:with="type=${@dict.getType('zl_subject_level')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            星级：<select name="starLevel" th:with="type=${@dict.getType('zl_song_xingji')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>

    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('project:song:edit')}]];
    var removeFlag = [[${@permission.hasPermi('project:song:remove')}]];
    var datas1 = [[${@dict.getType('zl_subject_level')}]];
    var datas2 = [[${@dict.getType('zl_song_xingji')}]];
    var prefix = ctx + "project/song";

    $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "音乐曲目",
                singleSelect : true, // 单选checkbox
                columns: [{
                    checkbox: true
                },
                    {
                        field : 'songId',
                        title : '编号'
                    },
                    {
                        field : 'songName',
                        title : '歌曲名'
                    },
                    {
                        field : 'starLevel',
                        title : '星级' ,
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datas2, value);
                        }
                    },
                    {
                        field : 'level',
                        title : '级别' ,
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datas1, value);
                        }
                    },
                    {
                        field : 'teacherCost',
                        title : '参考课时费'
                    },
                    {
                        field : 'remark',
                        title : '备注'
                    }]
            };
            $.table.init(options);
        }
    );
</script>
</body>
</html>